﻿@model PracticeAzure.Website.Data.CorrigendumReply

@*
this template must be nested in a <table> element
*@
<tr>
    <td style="width: 10%; font-size: 0.8em; vertical-align: top;">
        <div style="text-align: center;">
            <div class="avatar">
                @if (!string.IsNullOrWhiteSpace(Model.CreatedByAvatar))
                { 
                    @Html.Hidden("avatar-path", Model.CreatedByAvatar, new { @class = "avatar-path" })
                }
                <img src="/Content/anonymous.png" alt="Replier's Avatar" />
            </div>
            <div class="name">
                @if (string.IsNullOrWhiteSpace(Model.CreatedByEmail))
                {
                    <text>匿名人士</text>
                }
                else
                { 
                    @Model.CreatedByEmail.Split('@')[0]
                }
            </div>
            <div class="datetime">
                @Model.CreatedOn.ToString()
            </div>
        </div>
    </td>
    <td>
        <div class="reply-action-top" style="margin: 0px 0px 10px 0px; padding: 0px 0px 2px 0px; border-bottom-style: solid; border-bottom-width: 0px; border-bottom-color: #aaaaaa;">
            <div class="reply-action" style="text-align: right;">
                @if (PracticeAzure.Website.Shared.GlobalConfiguration.AllowReply)
                { 
                    <a href="#reply-box" class="@string.Format("reply-action_{0}", Model.ID)">回复</a>
                }
                @if (User.Identity.IsAuthenticated)
                {
                   <text> | </text>@Html.ActionLink("隐藏", "Hide", new { id = Model.ID, corrigendumId = Model.CorrigendumID })
                }
            </div>
        </div>
        <div class="reply-body" id="@string.Format("reply-body_{0}", Model.ID)">
            @Model.RenderedBody
        </div>
    </td>
</tr>